Skip to content

chore: delete dead Kotlin dns/, BootReceiver stub, unused Go bindings - #38

Merged
Hidden-Node merged 1 commit into
mainfrom
advisor/007-delete-dead-code
Jul 23, 2026
Merged

chore: delete dead Kotlin dns/, BootReceiver stub, unused Go bindings#38
Hidden-Node merged 1 commit into
mainfrom
advisor/007-delete-dead-code

Conversation

@Hidden-Node

Copy link
Copy Markdown
Owner

Removes ~517 lines of unreferenced code that has been superseded by the Go-side FakeDNS path (mobile/tun/fakedns_proxy.go) since commit 80d78aa.

Kotlin side:

  • Delete the legacy dns/ package (FakeDnsServer.kt, FakeDnsInterceptor.kt). The active FakeDNS path is Go-side through Mobile.startTunBridge(...).
  • Delete service/BootReceiver.kt (15-line comment-only stub). The matching commented-out RECEIVE_BOOT_COMPLETED permission block and entry are removed from AndroidManifest.xml. Auto-connect can be restored from git history when an explicit Settings UI lands.

Go side (mobile bridge surface shrink):

  • mobile/mobile.go: remove GetVersion, GetListenAddress, IsTunBridgeRunning, GetDNSMapping, GetDNSMappingCount, GetTunVersion. None of these are called from Kotlin (verified by grep). The unused internal/version import is dropped. Preserved: StartClient, StopClient, IsRunning, StartTun, StopTun, StartTunBridge, StopTunBridge, GetTunBandwidth (the live one reading trackedUp/trackedDown that VpnManager.kt:277,288 calls).
  • mobile/tun/tun_api.go: remove the dummy GetTunBandwidth (shadowed by the mobile.go version that Kotlin actually calls) and GetVersion (would collide with mobile.go's binding export; never reachable from Kotlin once mobile.go:GetTunVersion is gone).

Verification:

  • go build ./mobile/tun/... exits 0
  • go test ./mobile/tun/... (plan 006 tests) passes
  • git diff --quiet -- go.mod go.sum (unchanged; AGENTS.md invariant held)
  • 0 Android references to FakeDnsServer|FakeDnsInterceptor|BootReceiver
  • 0 Kotlin Mobile.* callers reference any deleted symbol

Local top-level go build ./mobile/... and the gradle/AAR build are gated by .github/workflows/android-ci.yml on push (pre-existing syscall.Dup-undefined-on-Windows blocks the top-level Go build locally, independent of this commit's edits).

Removes ~517 lines of unreferenced code that has been superseded by the
Go-side FakeDNS path (mobile/tun/fakedns_proxy.go) since commit 80d78aa.

Kotlin side:
- Delete the legacy dns/ package (FakeDnsServer.kt, FakeDnsInterceptor.kt).
  The active FakeDNS path is Go-side through Mobile.startTunBridge(...).
- Delete service/BootReceiver.kt (15-line comment-only stub). The matching
  commented-out RECEIVE_BOOT_COMPLETED permission block and <receiver>
  entry are removed from AndroidManifest.xml. Auto-connect can be restored
  from git history when an explicit Settings UI lands.

Go side (mobile bridge surface shrink):
- mobile/mobile.go: remove GetVersion, GetListenAddress,
  IsTunBridgeRunning, GetDNSMapping, GetDNSMappingCount, GetTunVersion.
  None of these are called from Kotlin (verified by grep). The unused
  internal/version import is dropped. Preserved: StartClient, StopClient,
  IsRunning, StartTun, StopTun, StartTunBridge, StopTunBridge,
  GetTunBandwidth (the live one reading trackedUp/trackedDown that
  VpnManager.kt:277,288 calls).
- mobile/tun/tun_api.go: remove the dummy GetTunBandwidth (shadowed by
  the mobile.go version that Kotlin actually calls) and GetVersion
  (would collide with mobile.go's binding export; never reachable from
  Kotlin once mobile.go:GetTunVersion is gone).

Verification:
- go build ./mobile/tun/... exits 0
- go test ./mobile/tun/... (plan 006 tests) passes
- git diff --quiet -- go.mod go.sum (unchanged; AGENTS.md invariant held)
- 0 Android references to FakeDnsServer|FakeDnsInterceptor|BootReceiver
- 0 Kotlin Mobile.* callers reference any deleted symbol

Local top-level `go build ./mobile/...` and the gradle/AAR build are
gated by .github/workflows/android-ci.yml on push (pre-existing
syscall.Dup-undefined-on-Windows blocks the top-level Go build locally,
independent of this commit's edits).
@Hidden-Node
Hidden-Node merged commit 111e1e5 into main Jul 23, 2026
2 checks passed
@Hidden-Node
Hidden-Node deleted the advisor/007-delete-dead-code branch July 23, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant